<template>
  <div class="videos">
    <div class="video-centered">
      <div class="video-header">
        <div class="video-display">
            <span class="left"></span>
            <h3>功能视频展示</h3>
            <p>VIDEO DISPLAY</p>
            <span class="right"></span> 
        </div>
      </div>   
      <div class="central">
        <dl class="first" v-for="(videoimage, index) in images" :key="index" @mouseover="wordsColor(index)" @mouseout="wordsColor_1(index)">
            <router-link :to="{name:'VideoPage',params:{id:videoimage.id}}" >
              <dt>
                <img :src="videoimage.cover" alt="视频图片">
                <img src="/home/static/imgs/video.png" alt="" class="center-img">
              </dt>
            </router-link>
            <dd>
            <router-link :to="{name:'VideoPage',params:{id:videoimage.id}}" class="title">
            {{videoimage.title}}
            </router-link>
            </dd>
        </dl>
      </div> 
      <router-link :to="{ path: '/ProductVideo'}" class="button">查看更多</router-link>
    </div>
  </div>
</template>
<script>
export default {
  name: 'Video',
  data(){
    return {
      images: []
    }
  },
  created(){
    var node = this;
    window.$.get(this.apiUrl + '/articles/index',{
        category: 3,
        per_page: 3,
        page: 1
    }, function (res) {
        node.images = res.data;
    })
  },
  methods:{
    wordsColor(index){
      let words = document.getElementsByClassName("title")[index];
      words.style.color = '#009ae9';
    },
    wordsColor_1(index){
       let words = document.getElementsByClassName("title")[index];
       words.style.color = '#000';
    }
  }
}
</script>
<style scoped>
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
button,
textarea,
p,
blockquote,
th,
td, {
  overflow: hidden;
}
a{
  text-decoration: none;
}
.videos{
  margin-top: 99px;
  width: 100%;
  height: 497px;
}
.video-centered{
  width: 1224px;
  height: 497px;
  margin: 0 auto;
  position: relative;
}
.videos .video-header{
  width: 100%;
  height: 61px;
}
.videos .video-header .video-display{
  width: 1224px;
  height: 61px;
  margin: 0 auto;
  text-align: center;
}
.videos .video-header .video-display h3{
  width: 218px;
  height: 45px;
  font-size: 36px;
  color: #110567;
  line-height: 30px;
  display: inline-block;
}
.videos .video-header .video-display p{
  width: 145px;
  height: 18px;
  font-size: 18px;
  line-height: 16px;
  color: #000;
  position: absolute;
  /* left: 538px; */
  top: 46px;
  right: 540px;
}
.videos .video-header .video-display .left{
  display: inline-block;
  width: 290px;
  height: 0px;
  border-top: solid 3px #009ae9;;
  position: absolute;
  left: 176px;
  top: 18px;
}
.videos .video-header .video-display .right{
  width: 290px;
  border-top: 3px solid #009ae9;;
  position: absolute;
  right: 176px;
  top: 18px;
}
.videos .video-centered .central{
  width: 1224px;
  height: 270px;
  margin-top: 61px;
  position: relative;
}
.videos .video-centered .central .first{
  width: 380px;
  height: 270px;
  margin-left: 15px;
  float: left;
 
  text-align: center;  
}
.videos .video-centered .central .first:nth-child(1){
  margin-left: 0;
}
.videos .video-centered .central .first dt{
  width: 380px;
  height: 220px;
  position: relative;
}
.videos .video-centered .central .first dt img{
  width: 100%;
  height: auto;
}
.videos .video-centered .central .first dt .center-img{
  width: 40px;
  height: 40px;
  position: absolute; 
  left: 0; 
  right: 0;
  top: 0;
  bottom: 0; 
  margin-left: auto; 
  margin-right: auto;
  margin-top: auto;
  margin-bottom: auto;
}
.videos .video-centered .central .first dd{
  width: 380px;
  height: 31px;
  color: #000;
  font-size: 24px;
  line-height: 31px;
  margin-top: 10px;
  overflow: hidden;
}
.videos .video-centered .central .first dd a{
  width: 100%;
  height: 63px;
}
.videos .video-centered .central .first a{
  text-decoration: none;
  width: 100%;
  height: auto;
}
.videos .video-centered .button{
  width: 170px;
  height: 50px;
  background-color: #009ae9;;
  border: 0;
  border-radius: 20px;
  outline: none;
  position: absolute;
  top: 447px;
  left: 530px;
  text-align: center;
  color: #fff;
  font-size: 18px;
  line-height: 50px;
}
</style>
